interval function fixes