adding rails env detection