Better implementation of timestamp
Exception for file writing; fixed authorization process